<template>
    <div class="brother">
        <h1>Brother2。。。兄弟组件2</h1>

        <h3>接收来自brother1传来的值是：{{msgFromBrother1}}</h3>
    </div>
</template>

<script>
    import eventBus from "@/eventBus";
    export default {
        name: "Brother2",
        data(){
            return{
                msgFromBrother1:''
            }
        },
        //数据接受方
        created() {
            eventBus.$on('share',val =>{
                this.msgFromBrother1 = val
            })
        }
    }
</script>

<style scoped>

</style>